/*
package com.yuanxiao.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/email")
@RefreshScope
public class EmailController {
    @Autowired
    private JavaMailSenderImpl javaMailSender;

    @GetMapping("/{email}/{code}")
    public Boolean sendEmail(@PathVariable String email,@PathVariable String code){
        if (StringUtils.isEmpty(email)){
            return false;
        }
        if (StringUtils.isEmpty(code)) {
            return false;

        }
        SimpleMailMessage simpleMailMessage = new SimpleMailMessage();
        simpleMailMessage.setSubject("注册验证码");
        simpleMailMessage.setText(code);
        simpleMailMessage.setTo(email);
        simpleMailMessage.setFrom("543859079@qq.com");
        javaMailSender.send(simpleMailMessage);
        return true;

    }
}
*/
